<?php
include_once("../../service/categoryService.php");

$catId = $_POST["catId"];
$categories = getAllParentCategoriesOf($catId, null);
$categories[] = array("id" => $catId);

foreach($categories as $each){
    $attributes = getAttributesOfCategory($each["id"]);
    
    while($row = ConnectionManager::getInstance()->fetch($attributes)){
        echo "<li><div>".$row["ATT_NAME"]."</div><input type='text' name='attributes[".$row["ATT_ID"]."]'/><input type='hidden' name='attIds[]' value='".$row["ATT_ID"]."'/></li>";        
    }
}
?>